//
//  ImageLabelView.m
//  FD
//
//  Created by Yasin on 2018/10/22.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "ImageLabelView.h"
@interface ImageLabelView()


@end

@implementation ImageLabelView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}

- (void)setupView {
    [self addSubview:self.iv];
    [self addSubview:self.lb];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self.iv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(10);
        make.centerY.equalTo(self.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(15, 18));
    }];
    
    [self.lb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iv.mas_right).offset(5);
        make.top.bottom.equalTo(self);
        make.right.equalTo(self.mas_right);//.offset(-10);
    }];
}


- (UIImageView *)iv {
    if (!_iv) {
        _iv = [UIImageView new];
    }
    return _iv;
}
- (UILabel *)lb {
    if (!_lb) {
        _lb = [UILabel new];
        _lb.numberOfLines = 0;
        _lb.font = [UIFont systemFontOfSize:15.0];
    }
    return _lb;
}

@end
